/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package it.evento;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Ilo
 */
@Embeddable
public class PreferencesPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDEVENT")
    private int idevent;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDUSER")
    private int iduser;

    public PreferencesPK() {
    }

    public PreferencesPK(int idevent, int iduser) {
        this.idevent = idevent;
        this.iduser = iduser;
    }

    public int getIdevent() {
        return idevent;
    }

    public void setIdevent(int idevent) {
        this.idevent = idevent;
    }

    public int getIduser() {
        return iduser;
    }

    public void setIduser(int iduser) {
        this.iduser = iduser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idevent;
        hash += (int) iduser;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PreferencesPK)) {
            return false;
        }
        PreferencesPK other = (PreferencesPK) object;
        if (this.idevent != other.idevent) {
            return false;
        }
        if (this.iduser != other.iduser) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "it.evento.PreferencesPK[ idevent=" + idevent + ", iduser=" + iduser + " ]";
    }
    
}
